home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / POV-Ray 3.0.2 / src / SOURCE / bcyl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-18  |  3.2 KB  |  91 lines  |  [TEXT/MPS ]

  1. /****************************************************************************
  2. *                   bcyl.h
  3. *
  4. *  This module contains all defines, typedefs, and prototypes for BCYL.C.
  5. *
  6. *  from Persistence of Vision(tm) Ray Tracer
  7. *  Copyright 1996 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. *  NOTICE: This source code file is provided so that users may experiment
  10. *  with enhancements to POV-Ray and to port the software to platforms other
  11. *  than those supported by the POV-Ray Team.  There are strict rules under
  12. *  which you are permitted to use this file.  The rules are in the file
  13. *  named POVLEGAL.DOC which should be distributed with this file. If
  14. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  16. *  Forum.  The latest version of POV-Ray may be found there as well.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23.  
  24. #ifndef BCYL_H
  25. #define BCYL_H
  26.  
  27.  
  28.  
  29. /*****************************************************************************
  30. * Global preprocessor defines
  31. ******************************************************************************/
  32.  
  33. /* Generate additional bcyl statistics. */
  34.  
  35. #define BCYL_EXTRA_STATS 1
  36.  
  37.  
  38. /*****************************************************************************
  39. * Global typedefs
  40. ******************************************************************************/
  41.  
  42. typedef struct BCyl_Struct BCYL;
  43. typedef struct BCyl_Entry_Struct BCYL_ENTRY;
  44. typedef struct BCyl_Intersection_Struct BCYL_INT;
  45.  
  46. struct BCyl_Intersection_Struct
  47. {
  48.   int n;     /* Number of cylinder hit    */
  49.   DBL d[2];  /* Intersection distance(s)  */
  50.   DBL w[2];  /* Intersection parameter(s) */
  51. };
  52.  
  53. struct BCyl_Entry_Struct
  54. {
  55.   short r1, r2;        /* Index of min/max segment radius */
  56.   short h1, h2;        /* Index of min/max segmnet height */
  57. };
  58.  
  59. struct BCyl_Struct
  60. {
  61.   int number;          /* Number of bounding cylinders.       */
  62.   short nradius;       /* Number of different bound-radii.    */
  63.   short nheight;       /* Number of different bound-heights.  */
  64.   DBL *radius;         /* List of different bound-radii.      */
  65.   DBL *height;         /* List of different bound-heights.    */
  66.   BCYL_INT *rint;      /* BCyl intersections list.            */
  67.   BCYL_INT *hint;      /* BCyl intersections list.            */
  68.   BCYL_INT *intervals; /* BCyl intersection intervals.        */
  69.   BCYL_ENTRY *entry;   /* BCyl elements.                      */
  70. };
  71.  
  72.  
  73.  
  74. /*****************************************************************************
  75. * Global variables
  76. ******************************************************************************/
  77.  
  78.  
  79.  
  80. /*****************************************************************************
  81. * Global functions
  82. ******************************************************************************/
  83.  
  84. BCYL *Create_BCyl PARAMS((int, DBL *, DBL *, DBL *, DBL *));
  85. void Destroy_BCyl PARAMS((BCYL *));
  86.  
  87. int  Intersect_BCyl PARAMS((BCYL *BCyl, VECTOR P, VECTOR D));
  88.  
  89.  
  90. #endif
  91.